package com.hzcc.hzccblog.shiro;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @Author 早睡蛋
 * @Date 2022/6/12 16:21:55
 * @Desc:Shiro统一拦截
 */
public class ShiroFilter {

    public static Map<String, String> linkedHashMap(){
        Map<String, String> filterChainDefinitionMap = new LinkedHashMap<>();
        filterChainDefinitionMap.put("/api/article/**","anon");
        filterChainDefinitionMap.put("/api/test/**","authc");
        filterChainDefinitionMap.put("/api/admin/**","anon");
        filterChainDefinitionMap.put("/api/login/**","anon");
        filterChainDefinitionMap.put("/article/images/**","anon");
        filterChainDefinitionMap.put("/myAvator/**","anon");
        filterChainDefinitionMap.put("/api/draft/**","anon");

        //swagger2免拦截
        filterChainDefinitionMap.put("/swagger-ui.html**", "anon");
        filterChainDefinitionMap.put("/v2/api-docs", "anon");
        filterChainDefinitionMap.put("/swagger-resources/**", "anon");
        filterChainDefinitionMap.put("/webjars/**", "anon");
        filterChainDefinitionMap.put("/doc.html", "anon");

        filterChainDefinitionMap.put("/**","authc");

        return filterChainDefinitionMap;
    }

}
